#include<bits/stdc++.h>
#define ll long long
using namespace std;

const char S[]="RGB";
const int P[]={0,1,2,1,2,0,2,0,1};

mt19937 mt_rand;
int n,m,x,y,z;
int col[105][105];
char s[1000005];
char bd[105][105]={"",
"0RGBBGRRGBBGRRGBBGRRGBBGRRGBBGR",
"0BGRRGBBGRRGBBGRRGBBGRRGBBGRRGB",
"0BRGGRBBRGGRBBRGGRBBRGGRBBRGGRB",
"0GRBBRGGRBBRGGRBBRGGRBBRGGRBBRG",
"0GBRRBGGBRRBGGBRRBGGBRRBGGBRRBG",
"0RBGGBRRBGGBRRBGGBRRBGGBRRBGGBR",
"0RGBBGRRGBBGRRGBBGRRGBBGRRGBBGR",
"0BGRRGBBGRRGBBGRRGBBGRRGBBGRRGB",
"0BRGGRBBRGGRBBRGGRBBRGGRBBRGGRB",
"0GRBBRGGRBBRGGRBBRGGRBBRGGRBBRG",
"0GBRRBGGBRRBGGBRRBGGBRRBGGBRRBG",
"0RBGGBRRBGGBRRBGGBRRBGGBRRBGGBR",
"0RGBBGRRGBBGRRGBBGRRGBBGRRGBBGR",
"0BGRRGBBGRRGBBGRRGBBGRRGBBGRRGB",
"0BRGGRBBRGGRBBRGGRBBRGGRBBRGGRB",
"0GRBBRGGRBBRGGRBBRGGRBBRGGRBBRG",
"0GBRRBGGBRRBGGBRRBGGBRRBGGBRRBG",
"0RBGGBRRBGGBRRBGGBRRBGGBRRBGGBR",
"0RGBBGRRGBBGRRGBBGRRGBBGRRGBBGR",
"0BGRRGBBGRRGBBGRRGBBGRRGBBGRRGB",
"0BRGGRBBRGGRBBRGGRBBRGGRBBRGGRB",
"0GRBBRGGRBBRGGRBBRGGRBBRGGRBBRG",
"0GBRRBGGBRRBGGBRRBGGBRRBGGBRRBG",
"0RBGGBRRBGGBRRBGGBRRBGGBRRBGGBR",
"0RGBBGRRGBBGRRGBBGRRGBBGRRGBBGR",
"0BGRRGBBGRRGBBGRRGBBGRRGBBGRRGB",
"0BRGGRBBRGGRBBRGGRBBRGGRBBRGGRB",
"0GRBBRGGRBBRGGRBBRGGRBBRGGRBBRG",
"0GBRRBGGBRRBGGBRRBGGBRRBGGBRRBG",
"0RBGGBRRBGGBRRBGGBRRBGGBRRBGGBR"};

inline void letsgo()
{
    col[0][0]=1e9;
    for(int i=1;i<=m/2;i++)
    {
        for(int j=1;j<=m/2;j++)
            col[i][j]=m-i-j;
    }
    for(int i=m/2+1;i<=m;i++)
    {
        for(int j=1;j<=m/2;j++)
            col[i][j]=i-j-1;
    }
    for(int i=1;i<=m/2;i++)
    {
        for(int j=m/2+1;j<=m;j++)
            col[i][j]=j-i-1;
    }
    for(int i=m/2+1;i<=m;i++)
    {
        for(int j=m/2+1;j<=m;j++)
            col[i][j]=i+j-m-2;
    }

    cout<<m<<' '<<m<<'\n';
    for(int i=1;i<=m;i++)
        cout<<(bd[i]+1)<<'\n';
}

inline void fid()
{
    for(int i=1;i<=m;i++)
    {
        if(bd[i][i]==s[1])
        {
            if(col[x][y]>col[i][i])
                x=y=i;
        }
    }
}

inline void walk(int a,int b,int c)
{
    x=y=0;
    if(bd[a-1][b]==s[c]&&(col[x][y]>col[a-1][b]||(col[x][y]==col[a-1][b]&&mt_rand()&1)))
        x=a-1,y=b;
    if(bd[a+1][b]==s[c]&&(col[x][y]>col[a+1][b]||(col[x][y]==col[a+1][b]&&mt_rand()&1)))
        x=a+1,y=b;
    if(bd[a][b-1]==s[c]&&(col[x][y]>col[a][b-1]||(col[x][y]==col[a][b-1]&&mt_rand()&1)))
        x=a,y=b-1;
    if(bd[a][b+1]==s[c]&&(col[x][y]>col[a][b+1]||(col[x][y]==col[a][b+1]&&mt_rand()&1)))
        x=a,y=b+1;

    if(x==0&&y==0)
    {
        cerr<<c<<'\n';
        cerr<<a<<' '<<b<<'\n';
        exit(0);
    }

    if(x==a-1)
        cout<<'U';
    if(x==a+1)
        cout<<'D';
    if(y==b-1)
        cout<<'L';
    if(y==b+1)
        cout<<'R';
    if(c==n)
        cout<<'\n';
}

int main()
{
    freopen("snake.in","r",stdin);
    freopen("snake.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    
    cin>>(s+1);
    n=strlen(s+1);

    srand(time(0));
    mt_rand.seed(rand());

    m=30;
        
    letsgo();
    fid();

    cout<<x<<' '<<y<<'\n';
    for(int i=2;i<=n;i++)
        walk(x,y,i);

    return 0;
}